package cn.ssm.service.impl;

import cn.ssm.bean.Category;
import cn.ssm.mapper.CategoryMapper;
import cn.ssm.service.CategoryService;
import cn.ssm.util.PageSite;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> list() {
        List<Category> lists = categoryMapper.list();
        return lists;
    }

    @Override
    public List<Category> list1(PageSite pageSite) {
        return categoryMapper.list1(pageSite);
    }

    @Override
    public int total() {
        return categoryMapper.count();
    }

    @Override
    public Category get(int id) {
        return categoryMapper.get(id);
    }

    @Override
    public void update(Category category) {
        categoryMapper.update(category);
    }

    @Override
    public void insert(Category category) {
        categoryMapper.add(category);
    }

    @Override
    public void delete(int id) {
        categoryMapper.delete(id);
    }
}
